package io.polly.controller;

import io.polly.annotation.Permission;
import io.polly.entity.ExamQuestionAnswer;
import io.polly.repository.ExamQuestionAnswerDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author liqin@101.com
 * @version V1.0
 * @title: ExamQuestionAnswerController
 * @description: TODO(用一句话描述该文件做什么)
 * @date: 2022/4/6 19:59
 */
@RestController
public class ExamQuestionAnswerController {

    @Autowired
    private ExamQuestionAnswerDAO examQuestionAnswerDAO;

    @RequestMapping("/answers")
    @Permission(value ={"myRole1","myRole2"})
    public List<ExamQuestionAnswer> getExamQuestionAnswers(@RequestParam("user_id")Long userId){
        examQuestionAnswerDAO.getExamQuestionAnswerByExamIdAndUserIdAndQuestionId("d7ebeeea-c8db-4fb1-a3fb-5220354749b3",206411242649L,"11bf17d0-b478-48f7-bb74-16e69617ff0d");
        return examQuestionAnswerDAO.getExamQuestionAnswerByExamIdAndUserIdAndQuestionId("d7ebeeea-c8db-4fb1-a3fb-5220354749b3",userId,"11bf17d0-b478-48f7-bb74-16e69617ff0d");
    }
}
